# 设置构建类型为 Debug，开启调试信息
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-g)

# 查找所有源码
file(GLOB_RECURSE SRC_FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp"
)

# 添加可执行文件
add_executable(hikvision_test main.cpp ${SRC_FILES})

# 包含头文件目录
target_include_directories(hikvision_test PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/3rdparty/hikvision/include
)

# 链接外部库
# 假设你已经确认 libhcnetsdk.so 存在于该目录中
target_link_directories(hikvision_test PRIVATE
    ${CMAKE_SOURCE_DIR}/3rdparty/hikvision/lib
)

# 链接库（必须确保名称和实际的 .so 文件一致）
target_link_libraries(hikvision_test PRIVATE
    hcnetsdk
)

# 打印调试路径（可选）
message(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")